<%= form_for(@book) do |f| %>
  <% if @book.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@book.errors.count, "error") %> prohibited this book from being saved:</h2>

      <ul>
      <% @book.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </div>
  <div class="field">
    <%= f.label :author %><br />
    <%= f.text_field :author %>
  </div>
  <div class="field">
    <%= f.label :code %><br />
    <%= f.text_field :code %>
  </div>
  <div class="field">
    <%= f.label :quantity %><br />
    <%= f.number_field :quantity %>
  </div>
  <div class="field">
    <%= f.label :current_quantity %><br />
    <%= f.number_field :current_quantity %>
  </div>
  <div class="field">
    <%= f.label :category_id %><br />
    <%= f.number_field :category_id %>
  </div>
  <div class="field">
    <%= f.label :price %><br />
    <%= f.text_field :price %>
  </div>
  <div class="field">
    <%= f.label :image_url %><br />
    <%= f.text_area :image_url %>
  </div>
  <div class="field">
    <%= f.label :numviewed %><br />
    <%= f.number_field :numviewed %>
  </div>
  <div class="field">
    <%= f.label :numborrowed %><br />
    <%= f.number_field :numborrowed %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
